package MyServlet;

import jakarta.servlet.*;
import jakarta.servlet.annotation.*;

import java.io.IOException;
import java.io.PrintWriter;

@WebFilter(filterName = "MyFilter02",urlPatterns = "/MyServlet2")
public class MyFilter02 implements Filter {
    public void init(FilterConfig config) throws ServletException {
    }

    public void destroy() {
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
        PrintWriter out=response.getWriter();
        out.println("MyFilter02 Before 你好");
        chain.doFilter(request, response);
        out.println("MyFilter02 After");
    }
}
